package com.service.impl;

import com.dao.QuestionDao;
import com.domain.Question;
import com.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("questionService")
public class QuestionServiceImp implements QuestionService {

    @Autowired
    QuestionDao questionDao;

    @Override
    public List<Question> findAllQuestion() {
        List<Question> questions= questionDao.findAllQuestion();
        return questions;
    }

    @Override
    public Boolean commitQuestion(Question question) {
        int r=questionDao.addOneQuestion(question);
        if (r==1){
            return true;
        }else {
            return false;
        }
    }
}
